package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {
    /**
     * 查询专辑的最大声音数
     */
    Integer selectMaxOrderNum(Long trackId);

    /**
     * 分页查询声音
     * @param trackInfoQuery
     * @param page
     * @return
     */
    IPage<TrackListVo> findUserTrackPage(@Param("vo") TrackInfoQuery trackInfoQuery, Page<TrackListVo> page);

    /**
     * 根据专辑id分页查询声音列表
     * @param albumId
     * @param objectPage
     * @return
     */
    IPage<AlbumTrackListVo> findAlbumTrackPage(@Param("albumId") Long albumId, Page<Object> objectPage);
}
